
BEGIN TRANSACTION
ALTER TABLE dbo.Appconfig ADD
	BarCode varchar(15) NOT NULL CONSTRAINT DF_Appconfig_BarCode DEFAULT 'QRD'
GO
COMMIT

/*--------------------------------------------------------*/

BEGIN TRANSACTION
GO
ALTER TABLE dbo.Items ADD
	Opening numeric(11, 2) NOT NULL CONSTRAINT DF_Items_Opening_1 DEFAULT ((0))
GO
COMMIT


/*--------------------------------------------------------*/

/****** Object:  View [dbo].[vw_Items]    Script Date: 07/28/2025 08:33:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*--------------------------------------------------------*/
ALTER VIEW [dbo].[vw_Items]
AS
SELECT     dbo.Items.GroupID, dbo.Groups.GroupCode, dbo.Groups.GroupName, dbo.Groups.GroupNameUrdu, dbo.Groups.Type, dbo.Items.ItemID, dbo.Items.ItemCode, dbo.Items.BarCode, dbo.Items.Opening, 
                      dbo.Items.ItemName, dbo.Items.ItemNameUrdu, dbo.Items.Discontinue, dbo.Items.InUnit, dbo.Items.PRate, dbo.Items.SRate, dbo.Items.PRate2, dbo.Items.SRate2, dbo.Items.ReOrder, 
                      dbo.Items.CompanyID, dbo.Company.CompanyCode, dbo.Company.CompanyName, dbo.Company.CompanyNameUrdu, dbo.Items.RackID, dbo.Rack.RackCode, dbo.Rack.RackName, 
                      dbo.Rack.RackNameUrdu
FROM         dbo.Company RIGHT OUTER JOIN
                      dbo.Items ON dbo.Company.CompanyID = dbo.Items.CompanyID LEFT OUTER JOIN
                      dbo.Groups ON dbo.Items.GroupID = dbo.Groups.GroupID LEFT OUTER JOIN
                      dbo.Rack ON dbo.Items.RackID = dbo.Rack.RackID